<template>
  <div>
    <van-nav-bar title="我的出租" left-arrow @click-left="onClickLeft" />
     <!-- 房子列表 -->
      <house-item
        v-for="(item, index) in newList"
        :key="index"
        :list="item"
      ></house-item>
  </div>
</template>

<script>
import HouseItem from '@/views/Search/components/HouseItem'
import { houstTorentAPI } from '@/api'
import { Toast } from 'vant'
export default {
  // 注册
  components: {
    HouseItem
  },
  data () {
    return {
      newList: []
    }
  },
  async created () {
    // 查看收藏列表
    console.log('收藏')
    const res = await houstTorentAPI({
      authorization: localStorage.getItem('token')
    })
    console.log(res)
    this.newList = res.data.body
  },
  methods: {
    onClickLeft () {
      Toast('返回')
      this.$router.back()
    }
  }
}
</script>

<style>

</style>
